package cn.catfish.mapper;

import cn.catfish.entity.BorrowRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RecordMapper {
    BorrowRecord getRecordById(int id);
    List<BorrowRecord> getAllRecords();
    List<BorrowRecord> getRecordsByUserId(int userId);
    List<BorrowRecord> getRecordsByBookId(int bookId);
    List<BorrowRecord> getRecordByUserAndBook(@Param("userId") int userId,@Param("bookId") int bookId);
    void insertRecord(BorrowRecord record);
    int deleteRecord(int id);
}
